package com.yonyou.isv.demo.openapi.api.exchangeratetype;

import com.yonyou.isv.demo.openapi.base.module.reponse.ApiDataArrayResponse;
import com.yonyou.isv.demo.openapi.base.module.reponse.ApiDataResponse;
import com.yonyou.isv.demo.openapi.api.BaseOpenApi;
import com.yonyou.isv.demo.openapi.api.OpenApiURL;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * description: 用友汇率类型开放平台接口
 *  @author: zpp
 *  @create: 2021-07-015
 */
@Component
public class ExchangerateTypeApi extends BaseOpenApi {
    public Map<String,Object> list(Map<String,Object> params)
    {
        ApiDataResponse apiDataResponse = postForEntity(OpenApiURL.EXCHANGERATETYPE_LIST, params, ApiDataResponse.class);
        return getData(apiDataResponse);
    }
    public Map<String, Object> detail(Map<String,String> params)
    {
        ApiDataResponse apiDataResponse = getForEntity(OpenApiURL.EXCHANGERATETYPE_DETAIL, params, ApiDataResponse.class);
        return getData(apiDataResponse);
    }
    public List<Map<String,Object>> findByTime(Map<String,String> params)
    {
        ApiDataArrayResponse apiDataArrayResponse = getForEntity(OpenApiURL.EXCHANGERATETYPE_FIND_BY_TIME, params, ApiDataArrayResponse.class);
        return getData(apiDataArrayResponse);
    }
    public Map<String,Object> type(Map<String,Object> params)
    {
        ApiDataResponse apiDataResponse = postForEntity(OpenApiURL.EXCHANGERATETYPE_TYPE, params, ApiDataResponse.class);
        return getData(apiDataResponse);
    }
    public Map<String,Object> save(Map<String,Object> params)
    {
        ApiDataResponse apiDataResponse = postForEntity(OpenApiURL.EXCHANGERATETYPE_SAVE, params, ApiDataResponse.class);
        return getData(apiDataResponse);
    }
    public Map<String,Object> enable(Map<String,Object> params)
    {
        ApiDataResponse apiDataResponse = postForEntity(OpenApiURL.EXCHANGERATETYPE_ENABLE, params, ApiDataResponse.class);
        return getData(apiDataResponse);
    }
    public Map<String,Object> disable(Map<String,Object> params)
    {
        ApiDataResponse apiDataResponse = postForEntity(OpenApiURL.EXCHANGERATETYPE_DISABLE, params, ApiDataResponse.class);
        return getData(apiDataResponse);
    }
    public Map<String,Object> delete(Map<String,Object> params)
    {
        ApiDataResponse apiDataResponse = postForEntity(OpenApiURL.EXCHANGERATETYPE_DELETE, params, ApiDataResponse.class);
        return getData(apiDataResponse);
    }
}
